Skip to content

Enhancements to the interface and bugfixes - #37

Merged
Marenz merged 5 commits into
frequenz-floss:v0.x.xfrom
Marenz:moar
Apr 24, 2024
Merged

Marenz merged 5 commits into
frequenz-floss:v0.x.xfrom
Marenz:moar

Conversation

@Marenz

@Marenz Marenz commented Apr 24, 2024 •

Copy link
Copy Markdown
Contributor

This is identical with #33
It was re-opened due to bugs in github, but was reviewed by luca and sahas

Marenz added 5 commits April 23, 2024 18:33
To properly convert from protobuf to datetime, one has to explicitly
handle the nanoseconds like so:

```python
    # Add microseconds and add nanoseconds converted to microseconds
    microseconds = int(ts.nanos / 1000)
    return datetime.fromtimestamp(ts.seconds + microseconds * 1e-6,
tz=tz)
```

We implemented a convert function that does exactly this, but we have
not been using it consistently yet. This commit replaces the last
occurances.

With that in mind, this commit changes:
* Consistently use the conversion function from the common repository
Fix start_time conversion imprecision bug
* Use shorter notations to set timezones
* Raise on invalid timezone in create()

Signed-off-by: Mathias L. Baumann <mathias.baumann@frequenz.com>
Makes it easier to handle & compare the request object with
a dispatch object, also adds more consistency overall.

Signed-off-by: Mathias L. Baumann <mathias.baumann@frequenz.com>
Some tests require extra checks to not rely on the order.

Signed-off-by: Mathias L. Baumann <mathias.baumann@frequenz.com>
Round start_time seconds to have the same behavior as the gRPC server
frequenz-io/frequenz-service-dispatch#77

Signed-off-by: Mathias L. Baumann <mathias.baumann@frequenz.com>
There is hardly any use-case for wanting to use `create()` and not have the
new dispatch available.

This is also in anticipation of the upcoming server-side feature that will
return the newly created dispatch.

Signed-off-by: Mathias L. Baumann <mathias.baumann@frequenz.com>
@Marenz
Marenz requested a review from a team as a code owner April 24, 2024 10:17
@github-actions github-actions Bot added part:docs Affects the documentation part:tests Affects the unit, integration and performance (benchmarks) tests labels Apr 24, 2024
@Marenz
Marenz added this pull request to the merge queue Apr 24, 2024
Merged via the queue into frequenz-floss:v0.x.x with commit bb6518e Apr 24, 2024
@Marenz
Marenz deleted the moar branch April 24, 2024 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

part:docs Affects the documentation part:tests Affects the unit, integration and performance (benchmarks) tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants